/* global Vue */
import Router from 'vue-router'
import LoginPage from '@/components/LoginPage.vue'
import RestPage from '@/components/RestPage.vue'
import RegisterPage from  '@/components/RegisterPage.vue'
import WelcomePage from '@/components/WelcomePage.vue'
import MainTabPage from '@/components/MainTabPage.vue'
import CommonListPage from '@/components/CommonListPage.vue'
import SearchPage from '@/components/SearchPage.vue'
import WebPage from '@/components/WebPage.vue'
import SettingPage from '@/components/SettingPage.vue'

import ProductDetailPage from  '@/components/Items/ProductDetailPage.vue'
import CreateOrder from '@/components/CreateOrder.vue'
import CourseDetail from '@/components/CourseDetail.vue'
import TestDetail from '@/components/TestDetail.vue'
import TaskDetail from '@/components/TaskDetail.vue'
import UpdateName from '@/components/UpdateName.vue'
import UpdateMobile from '@/components/UpdateMobile.vue'
import TestResult from '@/components/TestResult.vue'

import EventItem from '@/components/widget/EventItem.vue'
import HomeHeader from '@/components/widget/HomeHeader.vue'
import RepositoryItem from '@/components/widget/RepositoryItem.vue'
import OrderItem from '@/components/widget/OrderItem.vue'
import CourseItem from '@/components/widget/CourseItem.vue'
import TestItem from '@/components/widget/TestItem.vue'
import TaskItem from '@/components/widget/TaskItem.vue'
import OrderHeadItem from '@/components/widget/OrderHeadItem.vue'


Vue.use(Router)

Vue.component('EventItem', EventItem)
Vue.component('HomeHeader', HomeHeader)
Vue.component('RepositoryItem', RepositoryItem)
Vue.component('OrderItem', OrderItem)
Vue.component('CourseItem', CourseItem)
Vue.component('TestItem', TestItem)
Vue.component('TaskItem', TaskItem)
Vue.component('OrderHeadItem',OrderHeadItem)

module.exports = new Router({
  routes: [
    {
      path: '/login',
      name: 'LoginPage',
      component: LoginPage,
    },
    {
      path: '/rest',
      name: 'Rest',
      component: RestPage,
    },
    {
      path: '/register',
      name: 'RegisterPage',
      component: RegisterPage,
    },
    {
      path: '/',
      name: 'WelcomePage',
      component: WelcomePage,
    },
    {
      path: '/main',
      name: 'MainTabPage',
      component: MainTabPage,
      meta: {
        keepAlive: true,
      },
    },
    {
      path: '/product/:product',
      name: 'ProductDetailPage',
      component: ProductDetailPage
    },
    {
      path: '/create-order/:product',
      name: 'CreateOrder',
      component: CreateOrder
    },
    {
      path: '/common',
      name: 'CommonListPage',
      component: CommonListPage,
    },
    {
      path: '/search',
      name: 'SearchPage',
      component: SearchPage,
    },
    {
      path: '/web',
      name: 'WebPage',
      component: WebPage,
    },
    {
      path: '/setting',
      name: 'SettingPage',
      component: SettingPage,
    },
    {
      path: '/course-detail',
      name: 'CourseDetail',
      component: CourseDetail,
    },
    {
      path: '/test-detail',
      name: 'TestDetail',
      component: TestDetail,
    },
    {
      path: '/test-result',
      name:'TestResult',
      component:TestResult
    },
    {
      path: '/task-detail',
      name: 'TaskDetail',
      component: TaskDetail,
    },
    {
      path: '/update-mobile',
      name: 'UpdateMobile',
      component: UpdateMobile,
    },
    {
      path: '/update-name',
      name: 'UpdateName',
      component: UpdateName,
    }
  ],
})
